package com.example.sls.controller.field;

import com.example.sls.pojo.field.FieldManagement;
import com.example.sls.service.intserfaces.field.FieldManagementService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 场地信息管理表(FieldManagement)表控制层
 *
 * @author 蓝江富
 * @since 2024-06-19 13:23:44
 */
@RestController
@RequestMapping("field/fieldManagement")
public class FieldManagementController {
  @Autowired
  FieldManagementService fieldManagementService;

  @GetMapping("queryById")
  FieldManagement queryById(Integer id) {
    return fieldManagementService.queryById(id);
  }

  @GetMapping("queryAllByLimit")
  List<FieldManagement> queryAllByLimit(FieldManagement fieldManagement, Integer pageSize, Integer offset) {
    return fieldManagementService.queryAllByLimit(fieldManagement, pageSize, offset);
  }

  @GetMapping("count")
  long count() {
    return fieldManagementService.count();
  }

  @GetMapping("insert")
  int insert(FieldManagement fieldManagement) {
    return fieldManagementService.insert(fieldManagement);
  }

  @GetMapping("update")
  int update(FieldManagement fieldManagement) {
    return fieldManagementService.update(fieldManagement);
  }

  @GetMapping("deleteById")
  int deleteById(Integer id) {
    return fieldManagementService.deleteById(id);
  }
}

